# # 定义一个字典
# my_dict = dict()
# my_dict = {}
#
# dict1 = {'wangli': 99, 'zhangsan': 100, 'xiaowang': 67}
# print(dict1, type(dict1))
#
# # 字典的key不允许重复，后者会覆盖前者
#
# # key取得value
# print(dict1['wangli'])
# print(dict1['zhangsan'])
# print(dict1['xiaowang'])
#
# stu_dict = {
#     '王力宏': {
#         "语文": 77,
#         "数学": 66,
#         "英语": 33
#     },
#     '周杰伦': {
#         "语文": 88,
#         "数学": 86,
#         "英语": 55
#     },
#     '林俊杰': {
#         "语文": 99,
#         "数学": 96,
#         "英语": 66}
#     }
# print(stu_dict['王力宏']['语文'])
# print(stu_dict['周杰伦']['数学'])


# 字典常用操作
# 删除元素
# dict1 = {'wangli': 99, 'zhangsan': 100, 'xiaowang': 67}
# # ret = dict1.pop('zhangsan')
# # print(ret)
# # print(dict1)
# # dict1.clear()
# # print(dict1)
#
# # keys 获取字典中全部的key
# keys = dict1.keys()
# print(keys)
#
# # 遍历字典
# for key in keys:
#     print(dict1[key])
#
# for key in dict1:
#     print(dict1[key])
#
# # 统计字典中的元素数量
# num = len(dict1)
# print(num)

dict_employee = {
    '王力宏': {
        '部门': '科技部',
        '工资': 3000,
        '级别': 1
    },
    '周杰伦': {
        '部门': '市场部',
        '工资': 5000,
        '级别': 2
    },
    '林俊杰': {
        '部门': '市场部',
        '工资': 7000,
        '级别': 3
    },
    '张学友': {
        '部门': '科技部',
        '工资': 4000,
        '级别': 1
    },
    '刘德华': {
        '部门': '市场部',
        '工资': 6000,
        '级别': 2
    }
}
print("全体员工当前信息如下：")
print(dict_employee)
print("全体员工级别为1的员工完成升值加薪操作，操作后：")
for i in dict_employee:
    if dict_employee[i]['级别'] == 1:
        dict_employee[i]['级别'] = 2
        dict_employee[i]['工资'] += 1000

print(dict_employee)


